{include file='account/header.tpl'}
{include file='account/leftcol.tpl'}
<div id="left-area">
<div class="entry post clearfix width-for-all-img">
          <div class="breadcrumb">
            <span class="raquo"></span><a href="/">Главная</a>
           <span class="raquo"> &raquo; </span><a href="{geturl controller="account" action="index"}">Мой профиль</a>  
           <span class="raquo"> &raquo; </span><a href="{geturl controller='account' action='active'}">Мои покупки</a>  
    </div>
    <h1 class="category-title">Мои покупки</h1>
  
    <table class="tdzayavki" width="100%">
        <thead>
            <tr> 
                <td>
                    {if $sort=='productId'}
                    <a href="?sort=productId&order={if $order=='desc'}asc{else}desc{/if}" class="{$order}">Продукт</a>
                    {else}
                    <a href="?sort=productId&order={if $order=='desc'}asc{else}desc{/if}">Продукт</a>
                    {/if}
                </td>
                <td>
                    {if $sort=='shopId'}
                    <a href="?sort=shopId&order={if $order=='desc'}asc{else}desc{/if}" class="{$order}">Магазин</a>
                    {else}
                    <a href="?sort=shopId&order={if $order=='desc'}asc{else}desc{/if}">Магазин</a>
                    {/if}
                </td>
                
                
                  <td>
                    {if $sort=='shopId'}
                    <a href="?sort=status&order={if $order=='desc'}asc{else}desc{/if}" class="{$order}">Статус</a>
                    {else}
                    <a href="?sort=status&order={if $order=='desc'}asc{else}desc{/if}">Статус</a>
                    {/if}
                </td>
              
                <td class="tb5">Действие</td>
            </tr>
        </thead>

       {foreach from=$categories item=d}
        <tr id="tr_{$d->getId()}">
            <td class="" id="name_{$d->getId()}">
                  {$d->product->name}
            </td>
            <td>
                {$d->shop->nameshop}
            </td>
           
            <td>
                {$d->status}
            </td>
            <td>
                 <a href="{geturl route='zakaz' id=$d->getId()}"><img src="/images/smotret.png" alt="Подробнее"></a>
             
                <a onclick="deletezakaz({$d->getId()})" style="cursor: pointer"><img src="/images/index-07.png" alt="Удалить"></a>
                

            </td>

        </tr>
        {/foreach} 
    </table>      
    <div class="botline"></div>
   {if $pages != 1}
   <div class="pages">
            {section loop=$pages name=page}
                {assign var=p value=$smarty.section.page.index_next}
                {if $p == $page}
                    <span>{$p}</span>
                {else}
                 {if $p==1}
                    <a href="{geturl action='categories'}">{$p}</a>
                    {else}
                     <a href="{geturl action='categories'}?p={$p}">{$p}</a>
                    {/if}
                
                {/if}
            {/section}
        </div>
   {/if}


</div>
{include file="footer.tpl"}

